<!DOCTYPE HTML>
<html lang="zxx" xmlns:th="http://www.thymeleaf.org">

<head>
	<title>登录</title>
	<!-- Meta tag Keywords -->
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<meta charset="UTF-8" />
	<meta name="keywords" content=""
	/>
	<script>
		addEventListener("load", function () {
			setTimeout(hideURLbar, 0);
		}, false);

		function hideURLbar() {
			window.scrollTo(0, 1);
		}
	</script>
	<!-- Meta tag Keywords -->
	<!-- css files -->
	<link rel="stylesheet" href="css/style.css" type="text/css" media="all" />
	<!-- Style-CSS -->
	<link rel="stylesheet" href="css/font-awesome.4.7.0.css">
	<!-- Font-Awesome-Icons-CSS -->
	<!-- //css files -->
	<script src="../js/jquery-1.8.0.js"></script>
	<script>
		function doLogin() {
			var username=$("#username").val();
			var password=$("#password").val();
			$.ajax({
				url: "/login.do",
				type: "post",
				data: {
					username:username,
					password:password
				},
				success: function (user) {
					if (user.stateCode!=0){
						alert(user.state);
					}else {
						window.location.href="allUser.html";
					}
				}
			});

		}
	</script>
</head>

<body>
	<!-- bg effect -->
	<div id="bg">
		<canvas></canvas>
		<canvas></canvas>
		<canvas></canvas>
	</div>
	<!-- //bg effect -->
	<!-- title -->
	<h1>Fruit Mall</h1>
	<!-- //title -->
	<!-- content -->
	<center><label style="color: #90111A" th:text="${msg}"></label></center>
	<div class="sub-main-w3">
		<form action="#" method="post">
			<h2>登录
				<i class="fa fa-long-arrow-down"></i>
			</h2>
			<div class="form-style-agile">
				<label>
					<i class="fa fa-user"></i>
					用户名
				</label>
				<input placeholder="用户名" id="username" name="Name" type="text" required="">
				<font id="usernameTips"></font>
			</div>
			<div class="form-style-agile">
				<label>
					<i class="fa fa-unlock-alt"></i>
					密码
				</label>
				<input placeholder="密码" id="password" name="Password" type="password" required="">
				<font id="passwordTips"></font>
			</div>
			<!-- checkbox -->
			<div class="wthree-text">
				<ul>
					<li>
						<label class="anim">
							<!--<input type="checkbox" class="checkbox" required="">-->
							<span><a href="register.html">没有账号？<font color="aqua">注册</font>一个</a></span>
						</label>
					</li>
					<li>
						<a href="#">忘记密码?</a>
					</li>
				</ul>
			</div>
			<!-- //checkbox -->
			<input type="button" value="登录" onclick="doLogin()">
		</form>
	</div>
	<!-- //content -->

	<!-- copyright -->
	<div class="footer">
		
	</div>
	<!-- //copyright -->

	<!-- Jquery -->
	<script src="js/jquery-1.10.2.js"></script>
	<!-- //Jquery -->

	<!-- effect js -->
	<script src="js/canva_moving_effect.js"></script>
	<!-- //effect js -->

</body>

</html>